package com.timebank.volunteer.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.timebank.common.core.web.pojo.AjaxResult;
import com.timebank.volunteer.pojo.dto.ExamineDTO;
import com.timebank.volunteer.pojo.dto.VolunteerDTO;
import com.timebank.volunteer.pojo.dto.VolunteerSignDTO;
import com.timebank.volunteer.pojo.entity.Volunteer;
import com.timebank.volunteer.pojo.vo.VolunteerVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shiliuyinzhen
 */
@Service
public interface VolunteerService {

    /**
     * 分页查询志愿服务列表
     *
     * @param volunteerDTO
     * @return
     */
    List<Volunteer> selectVolunteerList(VolunteerDTO volunteerDTO);

    /**
     * 新增志愿服务
     * @param volunteerDTO
     * @return
     */
    AjaxResult insertVolunteer(VolunteerDTO volunteerDTO) throws JsonProcessingException;

    /**
     * 批量删除志愿服务
     * @param volunteerIds
     * @return
     */
    AjaxResult deleteVolunteerByIds(@Param("volunteerIds") Long[] volunteerIds);

    /**
     * 修改志愿服务信息
     * @param volunteerDTO
     * @return
     */
    int updateVolunteerById(@Param("volunteerId") Long volunteerId, @Param("volunteerDTO") VolunteerDTO volunteerDTO) throws JsonProcessingException;

    /**
     * 报名志愿服务
     * @param volunteerId
     * @return
     */
    AjaxResult signUpVolunteer(Long volunteerId);

    /**
     * 取消报名志愿服务
     * @param volunteerId
     * @return
     */
    AjaxResult cancelSignUpVolunteer(Long volunteerId);

    /**
     * 获取已报名志愿服务列表
     *
     * @return
     */
    List<VolunteerVO> getSignUpVolunteerList(VolunteerDTO volunteer);

    /**
     * 修改志愿服务封面
     * @param cover
     * @param volunteerId
     * @return
     */
    int updateVolunteerCoverById(String cover, Long volunteerId);

    /**
     * 根据id获取志愿服务
     * @param volunteerId
     * @return
     */
    VolunteerVO getVolunteerById(Long volunteerId);

    /**
     * 结束志愿服务
     * @param volunteerId
     * @return
     */
    AjaxResult endVolunteer(Long volunteerId);

    /**
     * 开始签到
     * @param volunteerSignDTO
     * @return
     */
    int beginSignIn(VolunteerSignDTO volunteerSignDTO);

    /**
     * 结束签到
     * @param volunteerId
     * @return
     */
    int endSignIn(Long volunteerId);

    /**
     * 审核通过
     * @param volunteerId
     * @return
     */
    AjaxResult approveVolunteer(Long volunteerId);

    /**
     * 审核不通过
     * @param examineDTO
     * @param volunteerId
     * @return
     */
    AjaxResult failVolunteer(Long volunteerId, ExamineDTO examineDTO);
}
